home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 June / EnigmA AMIGA RUN 08 (1996)(G.R. Edizioni)(IT)[!][issue 1996-06][EARSAN CD VII].iso / earcd / amos / amsls396.lzh / AMOSLIST / 000117_amos-request@svcs1.digex.net_Sat Mar 30 15:20:04 1996.msg < prev    next >
Internet Message Format  |  1996-04-01  |  4KB

  1. Received: from svcs1.digex.net (svcs1.digex.net [204.91.197.224]) by mail1.access.digex.net (8.6.12/8.6.12) with ESMTP id PAA15235;  for <mcox@access.digex.net> ; Sat, 30 Mar 1996 15:20:03 -0500
  2. Received: (from daemon@localhost) by svcs1.digex.net (8.6.12/8.6.12) id MAA26883 for amos-out; Sat, 30 Mar 1996 12:13:19 -0500
  3. Received: from mail1.access.digex.net (mail1.access.digex.net [205.197.247.2]) by svcs1.digex.net (8.6.12/8.6.12) with ESMTP id MAA26880 for <amos-list@svcs1.digex.net>; Sat, 30 Mar 1996 12:13:18 -0500
  4. Received: from kyoko.mpx.com.au (kyoko.mpx.com.au [203.2.75.2]) by mail1.access.digex.net (8.6.12/8.6.12) with ESMTP id MAA00974;  for <amos-list@access.digex.net> ; Sat, 30 Mar 1996 12:13:16 -0500
  5. Received: from cristal.mpx.com.au(really [203.2.75.8]) by kyoko.mpx.com.au
  6.     via smail with smtp
  7.     id <m0u34D8-0006WZC@kyoko.mpx.com.au>
  8.     for <amos-list@access.digex.net>; Sun, 31 Mar 96 03:13:10 +1000 (EST)
  9.     (/\##/\ Smail3.1.30.13 #30.8 built 5-oct-95)
  10. Received: from comlink.mpx.com.au by cristal.mpx.com.au with uucp
  11.     (Smail3.1.28.1 #3) id m0u34D6-0002OqC; Sun, 31 Mar 96 03:13 EDT
  12. Received: by comlink.mpx.com.au (V1.16/Amiga)
  13.     id AA02krh; Sat, 30 Mar 96 19:22:28 1100
  14. Date: Sat, 30 Mar 96 19:22:28 1100
  15. Message-Id: <9603310122.AA02krg@comlink.mpx.com.au>
  16. From: Darryl_Lewis@comlink.mpx.com.au (Darryl Lewis)
  17. To: amos-list@access.digex.net
  18. Subject: iff decoding
  19. Status: RO
  20. X-Status: 
  21.  
  22. I'm still trying to figure out how to read IFF files.
  23. I'm trying to figure out how to read the coulour of each pixel.
  24. Can anyone help me, I seem to be stuck figuring out how to decode the BODY
  25. to get the colour.
  26. Here's what I've go so far:
  27. --------cut-------------------
  28. _START:
  29. Screen Open 0,640,320,8,Hires
  30. Print 
  31. ' Ask for filename of picture
  32. F$=Fsel$("","","Please select your picture file")
  33. If F$="" Then End 
  34. ' Load picture file in bank 10 
  35. Open In 1,F$ : L=Lof(1) : Close 1
  36. Reserve As Work 10,L
  37. Bload F$,10
  38.  
  39. _POINTER=Start(10)
  40.  
  41. '************get basic info on picture 
  42.  
  43. POS=Hunt(_POINTER To Start(10)+Length(10),"BMHD")
  44. Print "BMHD position=",POS
  45. 'offset to start of data 
  46. POS=POS+8
  47. Print "Width of graphic=",Deek(POS+0)
  48. Print "Height of graphic=",Deek(POS+2)
  49. Print "X position of graphic=",Deek(POS+4)
  50. Print "Y position of graphic=",Deek(POS+6)
  51. BITPLANES=Peek(POS+8) : Print "bitplanes=",BITPLANES
  52. COMPRESSION=Peek(POS+10) : Print "compression=",COMPRESSION
  53. If Peek(POS+10)=0 Then Print " No encoding"
  54. If Peek(POS+10)=1 Then Print " RLE encoding"
  55. If Peek(POS+10)>1 Then Print " Unknown encoding. Cannot proceed."
  56. WIDTH=Deek(POS+16)
  57. Print "Width of source page=",WIDTH
  58. HEIGHT=Deek(POS+18)
  59. Print "Height of source page=",HEIGHT
  60.  
  61.  
  62. '*********** get the colour map data 
  63. S_COLOUR=2^BITPLANES
  64. Print "screen colours=",S_COLOUR
  65. POS=Hunt(_POINTER To Start(10)+Length(10),"CMAP")
  66. Print "Cmap position=",POS
  67. 'offset to start of data 
  68. POS=POS+8
  69. '************* calculate RGB Table 
  70. Print "R         G         B     RGB"
  71. For I=POS To POS+S_COLOUR-1 Step 3
  72.    RED=Peek(I+0)
  73.    GREEN=Peek(I+1)
  74.    BLUE=Peek(I+2)
  75.    RGB=(GREEN+16)*(RED+(1/16))*BLUE
  76.    Print RED;
  77.    Locate 9,
  78.    Print BLUE;
  79.    Locate 17,
  80.    Print GREEN;
  81.    Locate 25,
  82.    Print RGB
  83. Next 
  84.  
  85. '********************Body data 
  86. COUNT=0
  87. POS=Hunt(_POINTER To Start(10)+Length(10),"BODY")
  88. Print "BODY positions=",POS
  89. 'offset to data
  90. POS=POS+8
  91. For I=POS To POS+BITPLANES
  92.    Inc COUNT
  93.    Print COUNT,":",Peek(I)
  94. Next 
  95.  
  96. --------cut---------------------
  97.  
  98. -- Via DLG Pro v1.0
  99.  
  100. --
  101. Darryl
  102.  
  103. IMAGINE INFO   #####\             _             /#####    AMOS INFO
  104. Amiga 2000     #( )# |          _( )__         | #( )#  AmosPro + Compiler
  105. Amiga 3000T    ##### |         /_    /         | #####  APME (Get it!)
  106. 486DX2-66      #" "# |     ___m/I_ //_____     | #" "#  Turbo extension
  107. Imagine 3.0    # O # |____#-x.\ /++m\ /.x-#____| # O #  3D extension
  108. Intermediate   #m.m# |   /" \ ///###\\\ / "\   | #m.m#  BBS extension
  109.                #####/    ######/     \######    \#####
  110.              Profession- Disk Jockey/System Administrator
  111.                 http://www.dragonfire.net/~daz/home.htm